package com.twu.biblioteca.LibraryContents;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ppeter on 03/10/2014.
 */
public class Movie extends GenericCheckoutItem {
    String name;
    String director;
    int year;
    int rating;


    public Movie(String name_, String director_, int year_, int rating_, String id_) {
        super(id_);
        this.name = name_;
        this.director = director_;
        this.year = year_;
        this.rating = rating_;

    }

    @Override
    public List<String> getInfoColumns() {
        List<String> result = new ArrayList<String>();
        result.add(this.id);
        result.add(this.name);
        result.add(this.director);
        result.add(Integer.toString(this.year));
        if((this.rating > 0 ) && (this.rating < 11)){
            result.add(Integer.toString(this.rating));
        } else {
            result.add("unrated");
        }
        return result;
    }
}
